


clear
use phillips_jhr_cleandata




***
***Baseline Balance - Table 1
***

*applicant address characteristics
gen affluence = normal(-3.196399 + 0.1704157 * log(median_inc) + 0.009163 * fracwhite/100 + 0.2467624 * fracbacplus/100)

foreach var of varlist dist median_inc fracbacplus fracwhite affluence {
	qui reg `var' far, cluster(jobnum)
	lincom far
	qui reg `var' poor, cluster(jobnum)
	lincom poor
}

*employer characteristics
foreach var of varlist employerad_med employerad_fracbac employerad_fracwhite {
	qui reg `var' far, cluster(jobnum)
	lincom far
	qui reg `var' poor, cluster(jobnum)
	lincom poor
}

*applicant characteristics - including making Appendix Table 3
reg response white black female work_experience age work_gap profileXjob_*
predict yhat

foreach var of varlist white black age work_gap work_experience female yhat {
	qui reg `var' far, cluster(jobnum)
	lincom far
	qui reg `var' poor, cluster(jobnum)
	lincom poor
}

*positive response
foreach var of varlist response {
	qui reg `var' far, cluster(jobnum)
	lincom far
	qui reg `var' poor, cluster(jobnum)
	lincom poor
}

*means
sort addresstype
by addresstype: su dist median_inc fracbacplus fracwhite affluence  employerad_med employerad_fracbac employerad_fracwhite  white black age work_gap work_experience female yhat response



***
***Different possible affluence indices
***

*Appendix Table 2 - comparison of different indices

*gen affluence = normal(-3.196399 + 0.1704157 * log(median_inc) + 0.009163 * fracwhite/100 + 0.2467624 * fracbacplus/100)
gen affluence_white = normal(-1.514093 + 0.1986586*fracwhite)
gen affluence_inc = normal(-4.070234 + 0.262268*log(median_inc))
gen affluence_col = normal(-1.509036 + 0.4731301*fracbacplus)

correlate affluence*


*Appendix Table 1 - this is how coefficients are calculated from Bertrand and Mullainathan data

clear
use lakisha_aer.dta
probit call fraccolp fracwhite lmedhhinc
predict yhat_study

probit call fracwhite
predict yhat_white

probit call lmedhhinc
predict yhat_inc

probit call fraccolp
predict yhat_col

